//
//  MessageViewController.swift
//  微博（swift）
//
//  Created by 谢曦 on 2017/5/4.
//  Copyright © 2017年 谢曦. All rights reserved.
//

import UIKit

class MessageViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        placeView = setPlaceView()
     
    }
   
}


extension MessageViewController{

    fileprivate  func setPlaceView() -> UIView{
        let placeView = UIView()
        
        let image = UIImageView.init(image: UIImage.init(named: "visitordiscover_image_message"))
        let lable = UILabel()
        lable.text = "登陆后，这里将显示你收到的所有消息"
        lable.sizeToFit()
        lable.textColor=UIColor.init(hexString: "E1E1E1")
        
        let buttonRegister = UIButton()
        buttonRegister.setTitle("注册", for: .normal)
        buttonRegister.setTitleColor(UIColor.orange, for: .normal)
        buttonRegister.layer.borderColor=UIColor.init(hexString: "E1E1E1").cgColor
        buttonRegister.layer.borderWidth=1
        buttonRegister.addTarget(self, action: #selector(toRegister), for: .touchUpInside)
        
        
        let buttonLogin = UIButton()
        buttonLogin.setTitle("登陆", for: .normal)
        buttonLogin.setTitleColor(UIColor.init(hexString: "A3A3A3"), for: .normal)
        buttonLogin.layer.borderColor=UIColor.init(hexString: "E1E1E1").cgColor
        buttonLogin.layer.borderWidth=1
        buttonLogin.addTarget(self, action: #selector(toLogin), for: .touchUpInside)

        
        placeView.addSubview(image)
        placeView.addSubview(lable)
        placeView.addSubview(buttonRegister)
        placeView.addSubview(buttonLogin)

        
        image.snp.makeConstraints { (make) in
            make.center.equalTo(placeView)
        }
        lable.snp.makeConstraints { (make) in
            make.centerX.equalTo(placeView)
            make.top.equalTo(image.snp.bottom).offset(10)
        }
        // centerXWithinMargins 以X轴中间为基线
        buttonLogin.snp.makeConstraints { (make) in
            make.top.equalTo(lable.snp.bottom).offset(10)
            make.size.equalTo(CGSize(width:80,height:30))
            //左边 偏右
             make.left.equalTo(placeView.snp.centerXWithinMargins).offset(10)
        }
        buttonRegister.snp.makeConstraints { (make) in
            make.top.equalTo(lable.snp.bottom).offset(10)
            make.size.equalTo(CGSize(width:80,height:30))
            //右边偏左
            make.right.equalTo(placeView.snp.centerXWithinMargins).offset(-10)
           

        }
        

        
        return placeView
        
    }
    

}
